package br.com.sysreserva.util;

import javax.swing.JOptionPane;




import org.hibernate.Session;
import org.hibernate.Transaction;

import br.com.sysreserva.dao.EquipamentoDao;
import br.com.sysreserva.dao.SalaDao;
import br.com.sysreserva.entity.Equipamento;
import br.com.sysreserva.entity.Sala;

public class Main {

	public static void main(String[] args) {
		Equipamento equipamento = new Equipamento();
		Sala sala = new Sala();

		Session s = HibernateUtil.getSessionFactory().openSession();
		Transaction t = s.beginTransaction();

		equipamento.setNome("Andrey Gois");
		
		EquipamentoDao dao = new EquipamentoDao();
		SalaDao dao1 = new SalaDao();
		
		dao.save(equipamento);
		dao1.save(sala);

		t.commit();
	}
}
